<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>

    <script>
        /*  prototype
            作用：
                1.原型扩展  修改  内置构造函数(原型扩展)
        */

        function People()
        {
            this.name='trump'
            this.age=70
            this.run=function()
            {
                console.log('正在跑步');
            }
        }
        function Student()
        {
            this.study=function()
            {
                console.log('正在学习');
            }
        }

        
        Student.prototype=new People();  //利用原型继承  Student 继承了People
        //Student.prototype.constructor=Student  //要把原型的构造函数指回Student构造函数
        var stu=new Student()  
        console.log(stu);
        console.log(stu.name,stu.age);
        console.log(People.prototype);
    </script>
    
</body>
</html>